HAL ADC I/O operation function migration ¶
This section provides information about the HAL ADC I/O operation function migration.
HAL ADC start ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
The functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADC_Start
|
HAL_ADC_Start
HAL_ADC_REG_StartConv
|
Rationale: activation of the ADC is time consuming; the idea is to control the conversion start and stop without the need to fully deactivate and activate the ADC.
Related use case: Use case: conversion by polling
HAL ADC stop ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADC_Stop
|
HAL_ADC_REG_StopConv
HAL_ADC_Stop
|
Related use case: Use case: conversion by polling
HAL ADC start interrupt mode ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
The functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADC_Start_IT
|
HAL_ADC_Start
HAL_ADC_REG_StartConv_IT
|
Related use case: Use case: conversion by interruption
HAL ADC stop interrupt mode ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADC_Stop_IT
|
HAL_ADC_REG_StopConv_IT
HAL_ADC_Stop
|
Related use case: Use case: conversion by interruption
HAL ADC start DMA ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
The functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADC_Start_DMA
|
HAL_ADC_Start
HAL_ADC_REG_StartConv_DMA
|
Related use case: Use case: conversion in DMA mode
HAL ADC stop DMA ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADC_Stop_DMA
|
HAL_ADC_REG_StopConv_DMA
HAL_ADC_Stop
|
Related use case: Use case: conversion in DMA mode
HAL ADCEx injected start ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
The functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_InjectedStart
|
HAL_ADC_Start
HAL_ADC_INJ_StartConv
|
Related use case: Use case: conversion by polling
HAL ADCEx injected stop ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_InjectedStop
|
HAL_ADC_INJ_StopConv
HAL_ADC_Stop
|
Related use case: Use case: conversion by polling
HAL ADCEx injected start interrupt mode ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
The functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_InjectedStart_IT
|
HAL_ADC_Start
HAL_ADC_INJ_StartConv_IT
|
Related use case: Use case: conversion by polling
HAL ADCEx injected stop interrupt mode ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_InjectedStop_IT
|
HAL_ADC_INJ_StopConv_IT
HAL_ADC_Stop
|
Related use case: Use case: conversion by interruption
HAL ADCEx regular stop ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_RegularStop
|
HAL_ADC_REG_StopConv
HAL_ADC_Stop
|
Related use case: Use case: conversion by polling
HAL ADCEx regular stop interrupt mode ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_RegularStop_IT
|
HAL_ADC_REG_StopConv_IT
HAL_ADC_Stop
|
Related use case: Use case: conversion by interruption
HAL ADCEx regular stop DMA ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_RegularStop_DMA
|
HAL_ADC_REG_StopConv_DMA
HAL_ADC_Stop
|
Related use case: Use case: conversion in DMA mode
HAL ADCEx multimode start DMA ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
The functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_MultiModeStart_DMA
|
HAL_ADC_MM_Start
HAL_ADC_MM_REG_StartConv_DMA
|
Related use case: Use case: conversion in multimode DMA
HAL ADCEx multimode stop DMA ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_MultiModeStop_DMA
|
HAL_ADC_MM_REG_StopConv_DMA
HAL_ADC_MM_Stop
|
Related use case: Use case: conversion in multimode DMA
HAL ADCEx regular multimode stop DMA ¶
|
HAL1 |
HAL2 |
|---|---|
|
The
Functionality:
|
This functionality has been divided into two separate functions:
Functionality Split:
|
HAL_ADCEx_MultiModeStop_DMA
|
HAL_ADC_MM_REG_StopConv_DMA
HAL_ADC_MM_Stop
|
Related use case: Use case: conversion in multimode DMA
HAL ADCEx injected poll for conversion ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADCEx_InjectedPollForConversion |
HAL_ADC_INJ_PollForConv |
|
Parameters |
|
|
|
Return Value |
Returns HAL_OK , indicating successful polling for conversion completion, or HAL_TIMEOUT if a timeout occurs. |
Returns HAL_OK , indicating successful polling for conversion completion, or HAL_TIMEOUT if a timeout occurs. |
Related use case: Use case: conversion by polling
HAL ADCEx injected get value ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADCEx_InjectedGetValue |
HAL_ADC_INJ_GetValue |
|
Parameters |
|
|
|
Return Value |
Returns the ADC injected group conversion data. |
Returns the conversion data (signed value between -2147483648 and +2147483647). |
Related use case: Use case: conversion by polling
HAL ADC poll for conversion ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADC_PollForConversion |
HAL_ADC_REG_PollForConv |
|
Parameters |
|
|
|
Return Value |
Returns HAL_OK , indicating successful polling for conversion completion, or HAL_TIMEOUT if a timeout occurs. |
Returns HAL_OK , indicating successful polling for conversion completion, or HAL_TIMEOUT if a timeout occurs. |
Related use case: Use case: conversion by polling
HAL ADC poll for event ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADC_PollForEvent |
HAL_ADC_PollForEvent |
|
Parameters |
|
|
|
Return Value |
Returns HAL_OK , indicating successful polling for conversion completion, or HAL_TIMEOUT if a timeout occurs. |
Returns HAL_OK , indicating successful polling for conversion completion, or HAL_TIMEOUT if a timeout occurs. |
Related use case: Use case: conversion by polling
HAL ADC get value ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADC_GetValue |
HAL_ADC_REG_GetValue |
|
Parameters |
const ADC_HandleTypeDef *hadc |
const hal_adc_handle_t *hadc |
|
Return Value |
Returns the ADC regular group conversion data. |
Returns the conversion data (signed value between -2147483648 and +2147483647). |
Related use case: Use case: conversion by polling
HAL ADCEx multimode get value ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADCEx_MultiModeGetValue |
HAL_ADC_MM_REG_GetValue |
|
Parameters |
const ADC_HandleTypeDef *hadc |
|
|
Return Value |
Returns the converted data values. |
Returns the conversion data (unsigned value between 0x00000000 and 0xFFFFFFFF). |
Related use case: Use case: conversion in multimode DMA
HAL ADC IRQ handler ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADC_IRQHandler |
|
|
Parameters |
ADC_HandleTypeDef *hadc |
hal_adc_handle_t *hadc |
|
Return Value |
N/A. |
N/A. |
Related use case: Use case: conversion by interruption
HAL ADC error callback ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADC_ErrorCallback |
HAL_ADC_ErrorCallback |
|
Parameters |
ADC_HandleTypeDef* hadc |
hal_adc_handle_t *hadc |
|
Return Value |
N/A. |
N/A. |
Related use case: Use case: conversion by interruption
HAL ADC level out of window callback ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADC_LevelOutOfWindowCallback, HAL_ADCEx_LevelOutOfWindow2Callback, HAL_ADCEx_LevelOutOfWindow3Callback |
HAL_ADC_AnalogWD_OutOfWindowCallback |
|
Parameters |
ADC_HandleTypeDef *hadc |
|
|
Return Value |
N/A. |
N/A. |
Related use case: Use case: conversion by interruption
HAL ADC conversion half complete callback ¶
The difference between HAL1 and HAL2 is a simple renaming of the function.
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef *hadc) |
HAL_ADC_REG_DataTransferHalfCallback(hal_adc_handle_t *hadc) |
Related use case: Use case: conversion in DMA mode
HAL ADC conversion complete callback ¶
The difference between HAL1 and HAL2 is a simple renaming of the function.
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc) |
HAL_ADC_REG_DataTransferCpltCallback(hal_adc_handle_t *hadc) |
Related use case: Use case: conversion in DMA mode
HAL ADCEx calibration start ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADCEx_Calibration_Start |
HAL_ADC_Calibrate |
|
Parameters |
|
hal_adc_handle_t *hadc |
|
Return Value |
Returns HAL_OK if calibration is successful, HAL_ERROR if it fails. |
Returns HAL_OK if calibration is successful, HAL_ERROR if it fails. |
Related use case: Use case: conversion by polling
HAL ADCEx calibration get value ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADCEx_Calibration_GetValue |
HAL_ADC_GetCalibrationFactor |
|
Parameters |
|
|
|
Return Value |
Returns the selected ADC calibration value. |
Returns HAL_OK if calibration factors are successfully retrieved, HAL_ERROR if an error occurs, or HAL_INVALID_PARAM if the parameter is invalid. |
Related use case: Use case: conversion by polling
HAL ADCEx calibration set value ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Function name |
HAL_ADCEx_Calibration_SetValue |
HAL_ADC_SetCalibrationFactor |
|
Parameters |
|
|
|
Return Value |
Returns HAL_OK if the calibration factor is successfully set, HAL_ERROR if it fails. |
Returns HAL_OK if the calibration factors are successfully set, HAL_ERROR if an error occurs, or HAL_INVALID_PARAM if the parameter is invalid. |
Related use case: Use case: conversion by polling
HAL ADC start sampling ¶
|
HAL1 |
HAL2 |
|---|---|
|
HAL_ADC_StartSampling |
Removed; use LL_ADC_REG_StartSamplingPhase() instead. |
HAL ADC stop sampling ¶
|
HAL1 |
HAL2 |
|---|---|
|
HAL_ADC_StopSampling |
Removed; use LL_ADC_REG_StopSamplingPhase() instead. |
HAL ADCEx multimode get value data 32 ¶
|
HAL1 |
HAL2 |
|---|---|
|
HAL_ADCEx_MultiModeGetValue_Data32 |
Removed; use HAL_ADC_MM_REG_GetValue instead. |
HAL ADCEx multimode start DMA data 32 ¶
|
HAL1 |
HAL2 |
|---|---|
|
HAL_ADCEx_MultiModeStart_DMA_Data32 |
Removed; use HAL_ADCEx_MultiModeStart_DMA() instead. |